#include "EquSolver.h"
using namespace std;

int main()
{

	std::vector<std::vector<double>> A = { {4,3,0},{3,4,-1},{0,-1,4}};
	//A.resize(3);
	//for (int i = 0; i < 3; i++)
	//	A[i].resize(3);
	//A[0][0] = 0.012;
	//A[0][1] = 0.01;
	//A[0][2] = 0.167;

	//A[1][0] = 1;
	//A[1][1] = 0.8334;
	//A[1][2] = 5.91;

	//A[2][0] = 3200;
	//A[2][1] = 1200;
	//A[2][2] = 4.2;

	std::vector<double> b = { 16,20,-12 };
	std::vector<double> x;
	x.resize(3);
	//bool ret = SolveEqu_GuassColoumMainEle(A, 3, b, x);
	bool ret;
	if (!(ret = SolveEqu_GuassSeidel(A, 3, b, x, 0.5)))
	{
		ret = SolveEqu_GuassColoumMainEle(A, 3, b, x);
	}
	
	cout << "ret=" << ret << endl;
	for (int i = 0; i < 3; i++)
		cout << x[i] << endl;
	system("pause");
	return 0;
}